<template>
  <div class="bj_baseInfo-comp-ct c_page">
    <van-nav-bar :title="componentName" left-arrow @click-left="goback">
      <van-icon name="search" slot="right" />
    </van-nav-bar>
    <div class="c_container">
      <van-cell-group>
        <van-cell
          :title="item.displayName"
          :value="formData[item.name]"
          v-for="(item,idx) of formMap"
          :key="item.name"
          :class="{'backcolor':(idx%2==0)}"
        ></van-cell>
      </van-cell-group>
    </div>
  </div>
</template>
<script>
import Vue from "vue";
import { Toast, Icon, NavBar } from "vant";
Vue.use(Toast)
  .use(Icon)
  .use(NavBar);
export default {
  name: "bj_baseInfo",
  data() {
    return {
      componentName: "基本信息",
      projectId: -1,
      formMap: [],
      formData: {}
    };
  },
  methods: {
    goback() {
      this.$router.back(-1);
    },
  },
  mounted() {
    this.projectId = this.$route.params.pid;
    setTimeout(() => {
      //获取基本信息
      this.formMap = [
        { name: "UNIT_NAME", displayName: "建设单位" },
        { name: "QUA_CER", displayName: "社会信用代码" },
        { name: "LXR", displayName: "法人" },
        { name: "LXFS", displayName: "法人联系方式" },
        { name: "PROJECT_NAME", displayName: "项目名称" },
        { name: "EMAIL", displayName: "联系邮箱" },
        { name: "START_TIME", displayName: "计划开工时间" },
        { name: "END_TIME", displayName: "计划竣工时间" },
        { name: "CREATE_USERID", displayName: "报监负责人" },
        { name: "XCFZR", displayName: "现场负责人" },
        { name: "CKDJ", displayName: "防护等级" },
        { name: "FHDJ", displayName: "防化等级" },
        { name: "PROJECT_ADD", displayName: "工程地址" },
        { name: "TZSBH", displayName: "通知书编号" },
        { name: "TZSSBSJ", displayName: "通知书审批时间" }
      ];
      this.formData = {
        UNIT_NAME: "建设单位",
        QUA_CER: "社会信用代码",
        LXR: "法人",
        LXFS: "法人联系方式",
        PROJECT_NAME: "项目名称",
        EMAIL: "联系邮箱",
        START_TIME: "计划开工时间",
        END_TIME: "计划竣工时间",
        CREATE_USERID: "报监负责人",
        XCFZR: "现场负责人",
        CKDJ: "防护等级",
        FHDJ: "防化等级",
        PROJECT_ADD: "工程地址",
        TZSBH: "通知书编号",
        TZSSBSJ: "通知书审批时间"
      };
    }, 500);
  }
};
</script>
<style lang="scss" scoped>
.bj_baseInfo-comp-ct {
  .van-cell-group {
    margin: 5px 8px;
    .van-cell {
      .van-cell__title {
        text-align: left;
        font-weight: bold;
      }
      .van-cell__value {
        flex: 2;
        text-align: left;
      }
      line-height: 18px;
    }
    .backcolor {
      background-color: #dff3fa;
    }
  }
}
</style>
